#!/bin/bash
#----------------------------------------------------
# Job script for nightly AMPS tests on 
# TACC's Stampede system.
#----------------------------------------------------
#SBATCH -J AMPS_test      # Job name
# SBATCH -o test_intel.out # Name of stdout output file(%j expands to jobId)
# SBATCH -e %j.err         # Name of stderr output file(%j expands to jobId)

#SBATCH -p normal    # submit to the 'large' queue for jobs > 256 nodes
#SBATCH -N 1              # Total number of nodes requested (16 cores/node)
#SBATCH -n 16              # Total number of mpi tasks requested
#SBATCH -t 04:00:00       # Run time (hh:mm:ss) - 1.5 hours

#The next line is required if the user has more than one project
#SBATCH -A TG-EAR180012   # Allocation name to charge job against

# run AMPS tests compiled with Intel
cd Intel/AMPS
module load intel/17.0.4
make test_run TESTMPIRUN4="ibrun -n 4 -o 0" TESTMPIRUN1="ibrun -n 1 -o 0"  MPIRUN="ibrun -n 8 -o 0" >> test_amps.log 2>&1 & 
cd ../..

cd GNU/AMPS
module load gcc/7.1.0
make test_run TESTMPIRUN4="ibrun -n 4 -o 8" TESTMPIRUN1="ibrun -n 1 -o 8"  MPIRUN="ibrun -n 8 -o 8" >> test_amps.log 2>&1 & 
cd ../..

wait
echo Done > AmpsTestDone
